#ifndef _CGame_H
#define  _CGame_H

#include "Global.h"
#include "Input.h"
#include "ResourceManager.h"
#include "SceneManager.h"



class CGame
{
private:

	static CGame *_instance;

	Input* _input;

	DWORD _deltaTime;	
	int _mode;				
	int _isFullScreen;		
	int _frameRate; 
	int _depth;

	D3DFORMAT _backBufferFormat;

	LPWSTR _name;

	CGame();

	void _SetScreenDimension(int Mode);
	bool _InitWindow(HINSTANCE hInstance);
	bool _InitDirectX();
	bool _InitDirectSound();
	void _ReleaseDirectSound();


	void _Update(float Delta);
	void _Render();

	void _InitKeyboard();
	void _ProcessKeyBoard();

	void _StartRender();
	void _StopRender();
	void _Start2DRender();
	void _Stop2DRender();

public:
	
	static CGame* GetInstance();	
	~CGame();

	bool Init(HINSTANCE hInstance);
	void Run();
	void Release();

	HWND GetWindowHandle();
	LPDIRECT3DDEVICE9 GetD3DDevice();
	LPD3DXSPRITE GetSpriteHandle();
	LPDIRECT3DSURFACE9 GetBackBuffer();
	Input* GetInput();

	int GetMode();
	int GetScreenWidth();	
	int GetScreenHeight();	
	int GetDepth();	
	float GetFPS();		

	static LRESULT CALLBACK _WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);


private:


};

#endif